<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <span>{{msg}}</span>
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    Vue.config.productionTip = false;
    var vm = new Vue({
        el:"#app", //1.el帮我们指定了模板 2.确定了vm对应的挂载节点
        data:{
            msg:"msg"
        }
    })

    vm.$once("click",(val)=>{console.log(val)})
    vm.$on("damu",(val)=>{console.log(val)})
    setInterval(()=>{
        vm.$emit("damu","damu")
    },1000)
    setInterval(()=>{
        vm.$emit("click","click")
    },1000)
</script>
</html>